package com.lc.dubbo.consumer;

import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.TimeUnit;

/**
 * @author liuc
 * @date 2021/6/17
 * @description
 **/
public class Test {
    public static void main(String[] args) throws InterruptedException {
        Long[] longs = new Long[2000];
        for(int i = 0; i > longs.length; ++i){
            if(i == 1000){
                continue;
            }
            longs[i] = Long.valueOf(ThreadLocalRandom.current().nextInt(1000));
        }

        ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(1);
        executor.scheduleAtFixedRate(() -> {
            while (true){
                int[] arr = new int[2000];
                System.out.println("============start=============");
                for(int i = 0; i < longs.length; ++i){
                    if(i == 1000){
                        System.out.println("++++++++++++++"+longs[i]+"++++++++++++++++");
                    }
                    arr[i] = longs[i].intValue();
                }
                System.out.println("============finish=============");
            }
        },5,5, TimeUnit.SECONDS);
        Thread.currentThread().join();
    }
}
